package com.wipz.eoa.iphone.fixedassets;

import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.wipz.eoa.iphone.BaseAction;
import com.wipz.eoa.iphone.IBaseService;

/**
 * Title : �̶��ʲ����
 * 
 * Discription :�̶��ʲ����
 * 
 * Copyright: 2009-2015 ISoftStone Inc.
 * 
 * Compony:ISoftStone
 * 
 * @author mamingjie
 * @version 1.0
 */
public class FixedAssetsManageAction extends BaseAction{
	private static final long serialVersionUID = 1L;
	private IBaseService baseService;
	
	/**
	 * ����б�
	 */	
	private List list;
	
	/**
	 * �����б�
	 */	
	private List purchaseList;
	
	/**
	 * ά���б�
	 */	
	
	private List repaireList;
	/**
	 * �����б�
	 */	
	private List scrapList;
	
	
	/**
	 * ҳ����ϸ��Ϣ
	 */	
	
	private Object detail;

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public List getPurchaseList() {
		return purchaseList;
	}

	public void setPurchaseList(List purchaseList) {
		this.purchaseList = purchaseList;
	}

	public List getRepaireList() {
		return repaireList;
	}

	public void setRepaireList(List repaireList) {
		this.repaireList = repaireList;
	}

	public List getScrapList() {
		return scrapList;
	}

	public void setScrapList(List scrapList) {
		this.scrapList = scrapList;
	}
	
	public Object getDetail() {
		return detail;
	}

	public void setDetail(Object detail) {
		this.detail = detail;
	}

	public void setBaseService(IBaseService baseService) {
		this.baseService = baseService;
	}
	
	/**
	 * ��ù̶��ʲ����б���Ϣ(�ʲ��š��ʲ���ơ��ʲ����͡��ʲ��ͺš��ʲ�۸������ˡ������˲��š�����ʱ�䡢ʹ���ˡ��ʲ�״̬����λ���Ƿ�칫��Ʒ���Ƿ�ʹ����)
	 * Function-��ѯ���ʲ����
	 * @return 
	 */
	public String list(){
		Map params = new HashMap();
		String COMMITERCODE = this.getRequest().getParameter("COMMITERCODE");
		if(null == COMMITERCODE || COMMITERCODE.isEmpty()) {
			return SUCCESS;
		}
		String qcontent = this.getRequest().getParameter("qcontent");
		try {
			String s = new String(qcontent.getBytes("iso-8859-1"),"utf-8");
			qcontent = java.net.URLDecoder.decode(s, "utf-8");
		} catch (UnsupportedEncodingException e) {
			return SUCCESS;
		}
		params.put("COMMITERCODE", COMMITERCODE);
		params.put("qcontent", qcontent);
	
		//��ѯ�б���Ϣ
		list = baseService.queryList("fixedAssets.list",params);
		return SUCCESS;
	}

	/**
	 * ��ѯ�̶��ʲ�ɹ������б���Ϣ(�����š��ʲ��š��ʲ���ơ��ʲ����͡������ˡ������˲��š�����ʱ�䡢����״̬���¼������ˡ���ע)
	 * Function-��ѯ���ʲ����
	 * @return
	 */
	public String purchaseList(){
		
		String commiter = this.getRequest().getParameter("COMMITERCODE");
		if(null == commiter || commiter.isEmpty()) {
			return SUCCESS;
		}
		//��ȡ�����Ķ���
		Map params = new HashMap();
		//��ѯ����������������ʲ����
		String qcontent = this.getRequest().getParameter("qcontent");
		try {
			String s = new String(qcontent.getBytes("iso-8859-1"),"utf-8");
			qcontent = java.net.URLDecoder.decode(s, "utf-8");
		} catch (UnsupportedEncodingException e) {
			return SUCCESS;
		}
		//ʹ���˱��
	
		//��������뼯���� �ʲ����
		params.put("COMMITERCODE", commiter);
		params.put("qcontent", qcontent);
		params.put("APPLYTYPE", "0");
		//String processStatusFlag = (String)params.get("PROCESSSTATUSFLAG");
		//processStatusFlagΪTRUEʱ����ʾ������鿴������ͨ��Ĺ̶��ʲ�ɹ����뵥,�����ڹ̶��ʲ�ɹ��б���ֻ��ʾ״̬Ϊ0,1,3,4�Ĺ̶��ʲ�ɹ����뵥
		//if ("TRUE".equals(processStatusFlag)){
			//params.remove("PROCESSSTATUSFLAG");
		//}else{
			params.put("PROCESSSTATUSFLAG", "TRUE");
		//}
		purchaseList = baseService.queryList("fixedAssets.queryList",params);
		return SUCCESS;
	}

	/**
	 * ��ѯ�̶��ʲ�ά�������б���Ϣ(�����š��ʲ��š��ʲ���ơ��ʲ����͡������ˡ������˲��š�����ʱ�䡢����״̬���¼������ˡ���ע)
	 * Function-��ѯ���ʲ����
	 * @return
	 */
	public String repaireList(){
		//��ȡ�����Ķ���
		Map params = new HashMap();
		//��ѯ����������������ʲ����
		String qcontent = this.getRequest().getParameter("qcontent");
		try {
			String s = new String(qcontent.getBytes("iso-8859-1"),"utf-8");
			qcontent = java.net.URLDecoder.decode(s, "utf-8");
		} catch (UnsupportedEncodingException e) {
			return SUCCESS;
		}
		//ʹ���˱��
		String commiter = this.getRequest().getParameter("COMMITERCODE");
		//��������뼯���� �ʲ����
		params.put("COMMITERCODE", commiter);
		params.put("qcontent", qcontent);
		params.put("APPLYTYPE", "1");
		//String processStatusFlag = (String)params.get("PROCESSSTATUSFLAG");
		//processStatusFlagΪTRUEʱ����ʾ������鿴������ͨ��Ĺ̶��ʲ�ɹ����뵥,�����ڹ̶��ʲ�ɹ��б���ֻ��ʾ״̬Ϊ0,1,3,4�Ĺ̶��ʲ�ɹ����뵥
		//if ("TRUE".equals(processStatusFlag)){
			//params.remove("PROCESSSTATUSFLAG");
		//}else{
			params.put("PROCESSSTATUSFLAG", "TRUE");
		//}
		repaireList = baseService.queryList("fixedAssets.queryList",params);
		return SUCCESS;
	}
	/**
	 * ��ѯ�̶��ʲ�ά�������б���Ϣ(�����š��ʲ��š��ʲ���ơ��ʲ����͡������ˡ������˲��š�����ʱ�䡢����״̬���¼������ˡ���ע)
	 * Function-��ѯ���ʲ����
	 * @return
	 */
	public String scrapList(){
		//��ȡ�����Ķ���
		Map params = new HashMap();
		//��ѯ����������������ʲ����
		String qcontent = this.getRequest().getParameter("qcontent");
		try {
			String s = new String(qcontent.getBytes("iso-8859-1"),"utf-8");
			qcontent = java.net.URLDecoder.decode(s, "utf-8");
		} catch (UnsupportedEncodingException e) {
			return SUCCESS;
		}
		//ʹ���˱��
		String commiter = this.getRequest().getParameter("COMMITERCODE");
		//��������뼯���� �ʲ����
		params.put("COMMITERCODE", commiter);
		params.put("qcontent", qcontent);
		params.put("APPLYTYPE", "2");
		//String processStatusFlag = (String)params.get("PROCESSSTATUSFLAG");
		//processStatusFlagΪTRUEʱ����ʾ������鿴������ͨ��Ĺ̶��ʲ�ɹ����뵥,�����ڹ̶��ʲ�ɹ��б���ֻ��ʾ״̬Ϊ0,1,3,4�Ĺ̶��ʲ�ɹ����뵥
		//if ("TRUE".equals(processStatusFlag)){
			//params.remove("PROCESSSTATUSFLAG");
		//}else{
			params.put("PROCESSSTATUSFLAG", "TRUE");
		//}
		scrapList = baseService.queryList("fixedAssets.queryList",params);
		return SUCCESS;
	}
	/**
	 * �鿴�̶��ʲ�����Ϣ(�ʲ��š��ʲ���ơ��ʲ����͡��ʲ��ͺš��ʲ�۸������ˡ������˲��š�����ʱ�䡢ʹ���ˡ��ʲ�״̬����λ���Ƿ�칫��Ʒ���Ƿ�ʹ����)
	 * Function-�鿴:ID 
	 * @return 
	 */
	public String detail(){
		Map params = new HashMap();
		params.put("ID", this.getRequest().getParameter("id"));
		detail = baseService.queryOne("fixedAssets.queryByID", params);
		return SUCCESS;
	}
	
}
